package com.yx.cloud.activity;

import android.view.View;

import com.yx.cloud.R;
import com.yx.cloud.base.BaseActivity;
import com.yx.cloud.databinding.VoiceauthorizationmanagementActivityBinding;
import com.yx.cloud.utils.Intent_utils;
import com.yx.cloud.utils.RomUtils;

public class VoiceAuthorizationManagementActivity extends BaseActivity implements View.OnClickListener {

    private String type;
    private VoiceauthorizationmanagementActivityBinding binding;

    @Override
    public void onCreate() {
        binding = VoiceauthorizationmanagementActivityBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        initData();
    }

    private void initData() {
        type = getIntent().getStringExtra("type");
        if ("small_degree".equals(type)) {
            binding.tvAuthorizationName.setText(getString(R.string.small_degree));
            binding.ivAuthorizationIcon.setImageResource(R.mipmap.small_degree_icon);
        } else if ("tmall_Genie".equals(type)) {
            binding.tvAuthorizationName.setText(getString(R.string.Tmall_Genie));
            binding.ivAuthorizationIcon.setImageResource(R.mipmap.tmall_genie_icon);
        } else if ("google_Assistant".equals(type)) {
            binding.tvAuthorizationName.setText("Google Assistant");
            binding.ivAuthorizationIcon.setImageResource(R.mipmap.google_assistant_icon);
        } else if ("alexa".equals(type)) {
            binding.tvAuthorizationName.setText("Alexa");
            binding.ivAuthorizationIcon.setImageResource(R.mipmap.alexa_icon);
        }
        binding.ivThirdPartyReturn.setOnClickListener(this);
        binding.btnDeauthorize.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        if (RomUtils.isFastClick()) {
            return;
        }
        int id = v.getId();
        if (id == R.id.iv_Third_party_Return) {
            Intent_utils.backIntent(this);
        } else if (id == R.id.btn_Deauthorize) {

        }
    }
}
